package com.xiaochong.tir.trades.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2018/6/16.
 */
@Configuration
@Component
public class BittrexQueenConfig {
    @Bean
    public DirectExchange BitrexNodeAPIExchange() {
        return new DirectExchange(ExchangeQueue.Exchange.EX_NODE_API_MQ, true, false);
    }
    @Bean
    public Queue queueTradesBitrexBtcAction(){
        return new Queue(BittrexMqQueue.QUEUE_TRADES_BITTREX_BTC, true);
    }
    @Bean
    public Binding bindingTradesBitrexBtcAction(){
        return BindingBuilder.bind(queueTradesBitrexBtcAction()).to(BitrexNodeAPIExchange()).with(BittrexMqQueue.QUEUE_TRADES_BITTREX_BTC);
    }

}
